#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:exercise1.py
# author:wmf
# datetime:2021/4/8 14:56
# software: PyCharm
'''
this is function description
'''
# import module your need


# 定义一个高阶函数, 实现加,减,乘,除计算器功能;


def add(x,y):
    return x+y

def divide(x,y):
    return x/y

def subtract(x,y):
    return x-y

def multiply(x,y):
    return x*y

def do_calculate(x,y,func):
    return func(x,y)


print(do_calculate(10, 2, add))
print(do_calculate(10, 2, subtract))
print(do_calculate(10, 2, multiply))
print(do_calculate(10, 2, divide))